package fileDemo;

import com.tsing.cli.common.vo.ResultData;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

public class FileController {

    public ResultData test(@Validated Param param,
                           @RequestPart("imageFiles") MultipartFile[] imageFiles,
                           @RequestPart(value = "videoFile", required = false) MultipartFile videoFile) {
        return ResultData.success();
    }


    @Getter
    @Setter
    public class Param {

        @NotBlank(message = "id不能为空")
        private String id;

        @NotNull(message = "time不能为空")
        private Long time;

        private String other;

    }

}
